import xmRequest from '../index'
import { Account, LoginType } from './types'
import { DataType } from '../typed'
enum LoginAPI {
  AccountLogin = '/login',
  UserLoginInfo = '/users/',
  UserLoginMenu = '/role/'
}
export function accountLoginRequest(account: Account) {
  return xmRequest.post<DataType<LoginType>>({
    url: LoginAPI.AccountLogin,
    data: account
  })
}
export function requestUserInfoById(id: number) {
  return xmRequest.get<DataType>({
    url: LoginAPI.UserLoginInfo + id,
    showLoading: false
  })
}
export function requestUserMenusById(id: number) {
  return xmRequest.get<DataType>({
    url: LoginAPI.UserLoginMenu + id + '/menu',
    showLoading: false
  })
}
